package com.blue.seata.storage.api.fallback;

import com.blue.seata.storage.api.remote.RemoteStorageService;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * 服务降级处理
 *
 * @author liulei
 * @version 1.0
 */
@Component
public class RemoteStorageServiceFallbackFactory implements FallbackFactory<RemoteStorageService> {

    @Override
    public RemoteStorageService create(Throwable throwable) {
        RemoteStorageServiceFallBackImpl fallBack = new RemoteStorageServiceFallBackImpl();
        fallBack.setCause(throwable);
        return fallBack;
    }
}
